namespace TSL.BLL
{
    using System;
    using System.Collections.Generic;
    using System.Data;
    using TSL.DAL;
    using TSL.Model;

    public class SYS_users
    {
        private readonly TSL.DAL.SYS_users dal = new TSL.DAL.SYS_users();

        public void Add(TSL.Model.SYS_users model)
        {
            this.dal.Add(model);
        }

        public void AddMoney(TSL.Model.SYS_users model)
        {
            this.dal.AddMoney(model);
        }

        public void ChangeFD(string username, int fdnum)
        {
            this.dal.ChangeFD(username, fdnum);
        }

        public void Clean_User(string id)
        {
            this.dal.Clean_User(id);
        }

        public void Delete(string ID)
        {
            this.dal.Delete(ID);
        }

        public void DeleteUser(string ID)
        {
            this.dal.DeleteUser(ID);
        }

        public bool Exists(string name)
        {
            return this.dal.Exists(name);
        }

        public TSL.Model.SYS_users Get_Users_BankNum(string name)
        {
            return this.dal.Get_Users_BankNum(name);
        }

        public DataSet GetAllList()
        {
            return this.GetList("");
        }

        public DataSet GetList(string strWhere)
        {
            return this.dal.GetList(strWhere);
        }

        public List<TSL.Model.SYS_users> GetListArray(string strWhere)
        {
            return this.dal.GetListArray(strWhere);
        }

        public List<TSL.Model.SYS_users> GetListArrayPage(string strWhere, int PageNo, int PageSize, out int recordCount)
        {
            return this.dal.GetListArrayPage(strWhere, PageNo, PageSize, out recordCount);
        }

        public List<TSL.Model.SYS_users> GetListArray(string strWhere, string username)
        {
            return this.dal.GetListArray(strWhere, username);
        }

        public DataSet GetListFromView(string strWhere)
        {
            return this.dal.GetListFromView(strWhere);
        }

        public TSL.Model.SYS_users GetModel(string ID)
        {
            return this.dal.GetModel(ID);
        }

        public TSL.Model.SYS_users GetModel(string name, string password)
        {
            return this.dal.GetModel(name, password);
        }

        public TSL.Model.SYS_users GetModelByName(string name)
        {
            return this.dal.GetModelByName(name);
        }

        public TSL.Model.SYS_users GetModelByNameCache(string name)
        {
            string CacheKey = "GetModelByNameCache-cache-1" + name;
            object objModel = TSL.Common.DataCache.GetCache(CacheKey);
            if (objModel == null)
            {
                objModel = GetModelByName(name);
                if (objModel != null)
                {
                    int ModelCache = TSL.Common.ConfigHelper.GetConfigInt("ModelCache");
                    TSL.Common.DataCache.SetCache(CacheKey, objModel, DateTime.Now.AddMinutes(ModelCache), TimeSpan.Zero);
                }
            }
            return (TSL.Model.SYS_users)objModel;
        }

        public DataSet GetUserBank(string strWhere)
        {
            return this.dal.GetUserBank(strWhere);
        }

        public void QTAdd(TSL.Model.SYS_users model)
        {
            this.dal.QTAdd(model);
        }

        public void QTRegister(TSL.Model.SYS_users model)
        {
            this.dal.QTRegister(model);
        }

        public DataSet Total(string strWhere)
        {
            return this.dal.Total(strWhere);
        }

        public void Update(TSL.Model.SYS_users model)
        {
            this.dal.Update(model);
        }

        public void Update_FundPwd(string username, string pwd)
        {
            this.dal.Update_FundPwd(username, pwd);
        }

        public void Update_Pwd(string username, string pwd)
        {
            this.dal.Update_Pwd(username, pwd);
        }

        public void UpdateLogin(TSL.Model.SYS_users model)
        {
            this.dal.UpdateLogin(model);
        }

        public void UpdatePwd(TSL.Model.SYS_users model)
        {
            this.dal.UpdatePwd(model);
        }

        public void UpdateUser(TSL.Model.SYS_users model)
        {
            this.dal.UpdateUser(model);
        }
    }
}

